<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix='sec' uri='http://www.springframework.org/security/tags'%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
<style type="text/css">
	.item{
		width: 95px;
		display: inline-block;
		margin-left: 5px;
	}
</style>
</head>
<body style="border: 0px; margin: 0px; padding: 0px;width: 100%;height: 100%">
	<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
		<table width="100%" border="0">
			 <tr>
			   	<td style="width:30%;">
			   	  <span class="item">时间(开始时间)：</span>
			      <input id="leastCall" class="mini-datepicker" emptyText="请选择..." style="width:180px;" format="yyyy-MM-dd H:mm:ss" timeFormat="H:mm:ss" showTime="true" allowInput="false" /> 
			    </td>
			    <td style="width:30%;">
			      <span class="item">时间(截止时间)：</span>
			      <input id="firstCall" class="mini-datepicker" emptyText="请选择..." style="width:180px;" format="yyyy-MM-dd H:mm:ss" timeFormat="H:mm:ss" showTime="true" allowInput="false" /> 
			    </td>
			    <td style="width:30%;">
			      <span class="item">呼入电话(精确)：</span>
			      <input id="callerNum" class="mini-textbox" emptyText="请输入呼入电话号码"   style="width:180px;"/> 
			    </td>
			    <td style="width:30%;"> </td>
			 </tr>
			 <tr>
			   	<td style="width:30%;" colspan="3">
			   	  <span class="item">订单数(精确)：</span>
			      <input id="ordersCount" class="mini-textbox" emptyText="请输入订单数"   style="width:180px;"/>
			    </td>
			    <td style="white-space:nowrap;"><a class="mini-button" iconCls="icon-search" onclick="search()">查询</a> </td>
			 </tr>
		</table>          
	</div>
	<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
	    <table style="width:100%;">
	        <tr>
	            <td style="width:100%;">
	            	<sec:authorize url='/call_duplicate_view_exports.do'>
		            <a class="mini-button" iconCls="icon-download" onclick="exportData()">导出全部</a>    
		            </sec:authorize>
	            </td>
	        </tr>
	    </table>           
	</div>
	<div class="mini-fit" >
	<div id="datagrid1" class="mini-datagrid" url="call_duplicate_view.do" idField="id" pageSize="20" multiSelect="true" style="width:100%;height:100%;">
		<div property="columns">
			<div type="indexcolumn"></div>
			<div type="checkcolumn" checked="false" ></div>
			<div field="callerNum" width="100" headerAlign="center" align="center">呼入电话</div>
			<div field="leastCall" dataType="date" dateFormat="yyyy-MM-dd HH:mm:ss" width="100" headerAlign="center" align="center">最近呼入</div>
			<div field="answerCount" width="100" headerAlign="center" align="center">接起次数</div>
			<div field="firstCall" dataType="date" dateFormat="yyyy-MM-dd HH:mm:ss" width="100" headerAlign="center" align="center">最早呼入</div>
			<div field="callCount" width="100" headerAlign="center" align="center">呼入次数</div>
			<div field="province" width="100" headerAlign="center" align="center">地址省</div>
			<div field="ordersCount" width="100" headerAlign="center" align="center">订单数</div>
		</div>
	</div>
	</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");
grid.load();

function search() {
	var leastCall = mini.get("leastCall").getFormValue();
	var firstCall = mini.get("firstCall").getFormValue();
	var callerNum = mini.get("callerNum").getFormValue();
	var ordersCount = mini.get("ordersCount").getFormValue();
	grid.load({ leastCall:leastCall,firstCall:firstCall,callerNum:callerNum,ordersCount:ordersCount});
}

//导出全部
function exportData(){
	var leastCall = mini.get("leastCall").getFormValue();
	var firstCall = mini.get("firstCall").getFormValue();
	var callerNum = mini.get("callerNum").getFormValue();
	var ordersCount = mini.get("ordersCount").getFormValue();
	location.href="call_duplicate_view_exports.do?leastCall="+leastCall+"&firstCall="+firstCall+"&callerNum="+callerNum+"&ordersCount="
			+ordersCount; 
}

</script>
</body>
</html>